<?

global $_APP_OBJECT_MENU;

$_APP_OBJECT_MENU = array (
	array (label=>"Access Administrator",link=>"accounts/",
		style=>"vmc_menu_option_a",
		options=>array (
			array (
				label=>"Account Manager",
				link=>"users/",
				style=>"vmc_menu_option_b"
			),
			array (
				label=>"Modules",
				link=>"modules/",
				style=>"vmc_menu_option_b"
			),
			array (
				label=>"Roles",
				link=>"roles/",
				style=>"vmc_menu_option_b"
			),
			array (
				label=>"Workgroups",
				link=>"workgroups/",
				style=>"vmc_menu_option_b"
			),
			array(
				label=>"Objects",
				link=>"objects/",
				style=>"vmc_menu_option_b"
			)
		),
	),
);

function _app_iface_navigation_begin ($container) {

	print <<<HTML

	<div class="vmc_iface_navigation">

<div class="vmc_main_console_panel">

<div id="vmc_main_access_administrator" class="vmc_main_menu_panel">
	<a class="vmc_main_link" onmouseover="javascript:toggle_visible ('ecm_tooltip_bubble');" onmouseout="javascript:toggle_visible ('ecm_tooltip_bubble');" onmousemove="javascript:return move_bubble ('ecm_tooltip_bubble');">Access Administrator</a>
	<a class="vmc_main_sublink" href="/admin/accounts/users/">Account Manager</a>,
	<a class="vmc_main_sublink" href="/admin/accounts/modules/">Module</a>,
	<a class="vmc_main_sublink" href="/admin/accounts/roles/">Roles</a>,
	<a class="vmc_main_sublink" href="/admin/accounts/workgroups/">Workgroups</a>,
	<a class="vmc_main_sublink" href="/admin/accounts/objects/">Objects</a>
</div><!-- end vmc_main_access_administrator -->

</div><!-- end vmc_main_console_panel -->

<div class="vmc_main_console_panel">
	<div class="vmc_tab_pane">
		<div class="vmc_tab_pane_tabs">
			<ul>
				<li><a id="vmc_item_details" href="data_1">Item Details</a></li>
				<li><a id="vmc_related_data" href="data_2">Related Data</a></li>
			</ul>
		</div>
		<div class="vmc_tab_pane_content">
			Some data
		</div>
	</div>
</div><!-- end vmc_main_console_panel -->

	</div><!-- end vmc_iface_navigation -->


HTML;
}

function _app_iface_display_begin ($container) {

	print <<<HTML

	<div class="vmc_iface_display">



HTML;
}

function _app_iface_display_end ($container) {

	print <<<HTML

	</div>

HTML;
}

function _app_iface_navigation () {

	global $_APP_OBJECT_MENU;

	$_APP_MENU = new Container ();
	$_APP_MENU->set_callback_begin ("_app_iface_menu_begin");
	$_APP_MENU->set_callback_end ("_app_iface_menu_end");

	_app_create_menu ($_APP_MENU, $_APP_OBJECT_MENU);

	return $_APP_MENU;
}

function _app_create_menu ($container, $options) {

	foreach ($options as $option) {

		$_APP_MENU_OPTION = new Container ();
		$_APP_MENU_OPTION->set_callback_begin
				("_app_iface_menu_option");
		$_APP_MENU_OPTION->set_option
				("callback_end", false);
		$_APP_MENU_OPTION->set_variable ("label", $option["label"]);
		$_APP_MENU_OPTION->set_variable ("link",
				$container->get_variable ("link") .
				$option["link"]);
		$_APP_MENU_OPTION->set_variable ("class", $option["style"]);

		if ($option["options"]) _app_create_menu
				($_APP_MENU_OPTION, $option["options"]);

		$container->insert_container ($_APP_MENU_OPTION);
	}
}

function _app_iface_menu_begin ($container) {

	print <<<HTML
<table cellpadding="0" cellspacing="0" class="vmc_main_navigation">

HTML;
}

function _app_iface_menu_end ($container) {

	print <<<HTML
</table>


HTML;
}

function _app_iface_menu_option ($container) {

	print <<<HTML
<tr><td class="{$container->get_variable ("class")}"><a href="/admin/{$container->get_variable ("link")}" class="{$container->get_variable ("class")}">::&nbsp;{$container->get_variable ("label")}</a></td></tr>

HTML;
}

function _app_tab ($container) {

	$primary_key = $container->get_variable ("primary_key");
	$primary_value = $container->get_variable ("primary_value");
	$label = $container->get_variable ("label");

	$label = ($wrapper = $container->get_variable ("wrapper")) ?
			<<<HTML
<div class="{$wrapper}">{$label}</div>
HTML
			: $label;

	print <<<HTML
	<td class="{$container->get_variable ("class")}" onmouseover="javascript: this.className='vmc_tabbing_c';" onmouseout="javascript: this.className='{$container->get_variable ("class")}';"><a class="vmc_tabbing" href="?{$container->get_variable ("fs_tab_id")}={$container->get_variable ("fs_tab")}&{$primary_key}={$primary_value}&{$container->get_variable ("options")}">{$label}</a></td>

HTML;
}

function _app_tab_row_split ($container) {

	print <<<HTML
</tr>
</table>

	</td>
</tr>
<tr>
	<td>

<table class="vmc_tabbing" border="0" cellpadding="0" cellspacing="0">
<tr>

HTML;
}

function _app_tabbing_begin ($container) {

	print <<<HTML
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="1">
<tr>
	<td>


<table class="vmc_tabbing" border="0" cellpadding="0" cellspacing="0">
<tr>

HTML;
}

function _app_tabbing_end ($container) {

	print <<<HTML
</tr>
</table>

	</td>
</tr>
</table>
<br>

HTML;
}

function _app_tabbing_container_begin ($container) {

	print <<<HTML
<div class="vmc_tabbing_container">

HTML;
}

function _app_tabbing_container_end ($container) {

	print <<<HTML
</div>

HTML;
}

function _app_tabbing_tabs_begin ($container) {

	print <<<HTML
<div class="vmc_tabbing_tabs">

HTML;
}

function _app_tabbing_tabs_end ($container) {

	print <<<HTML
</div>

HTML;
}

function _app_tabbing_panel_begin ($container) {

	print <<<HTML
<div class="vmc_tabbing_panel">

HTML;
}

function _app_tabbing_panel_end ($container) {

	print <<<HTML
</div>

HTML;
}

?>
